# 本文件的名字tasks.py的名字是规定死的
import random

from celery_tasks.main import celery_app
from ronglian_sms_sdk import SmsSDK

@celery_app.task()
def send_message(mobile, mobile_code):

    accId = '8a216da8797924980179acccb27311ee'
    accToken = 'e54d9441a4724ee2915df911e9115b5d'
    appId = '8a216da8797924980179acccb36611f4'

    sdk = SmsSDK(accId, accToken, appId)
    tid = '1'
    # mobile = mobile
    datas = (mobile_code, '10')
    resp = sdk.sendMessage(tid, mobile, datas)
    return resp